Skip to content

Instantly share code, notes, and snippets.

@nickrouty
nickrouty / rd-class-text-extraction.php
Created May 9, 2018 04:14
Class for extraction the text from doc, docx, xlsx, pptx and wrapper for 3rd party pdf to text library.
<?php
/**
* Class RD_Text_Extraction
*
* Example usage:
*
* $response = RD_Text_Extraction::convert_to_text($path_to_valid_file);
*
* For PDF text extraction, this class requires the Smalot\PdfParser\Parser class.
@ctlllll
ctlllll / longest_chinese_tokens_gpt4o.py
Created May 13, 2024 19:53
Longest Chinese tokens in gpt4o
import tiktoken
import langdetect
T = tiktoken.get_encoding("o200k_base")
length_dict = {}
for i in range(T.n_vocab):
try:
length_dict[i] = len(T.decode([i]))
except:
@realvjy
realvjy / ChoasLinesShader.metal
Last active May 22, 2024 03:10
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@Jonas-Sander
Jonas-Sander / awtrix_spotify_nowPlaying.yaml
Last active May 22, 2024 03:08
awtrix_spotify_nowPlaying.yaml
alias: Awtrix Spotify NowPlaying 🎹
description:
trigger:
- platform: state
entity_id: media_player.spotify
action:
- choose:
- conditions:
- condition: state
entity_id: media_player.spotify
@ZenGround0
ZenGround0 / OPP.md
Created May 22, 2024 01:57
Onramp Protocol Prototype

Summary

The FVM brings smart contracts to filecoin allowing developers to do productive novel things with verifiable data. One obvious thing to do is allow clients to put data on filecoin more easily. Enabling onboarding small pieces is better for users but worse for scale which motivates bridging to higher throughput lower latency lower cost systems like blockchain L2s. Some redesigning of the standard client contract flow is needed for things to work on L2s. Essentially the contract should be split into two halves: an expensive contract onboarding, aggregating and paying for data and an efficient contract transmitting proof of data storage.

FilOz is building a prototype of this here: https://github.com/ZenGround0/onramp-contracts/tree/main so that developers can build applications more easily following this design.

We're currently prototyping. First getting it working with L1 and L2 == Filecoin, then getting it working with true bridging on calibration net. Once we're done we'll measure performance

@arxdsilva
arxdsilva / tokenGeneratorExample.go
Last active May 22, 2024 03:06
Golang - How to generate a random Token
package main
// https://play.golang.org/p/5VsRVVtyo-J
import (
"crypto/rand"
"fmt"
)
func tokenGenerator() string {
@karlhorky
karlhorky / migrate-to-eslint-plugin-import-x.diff
Last active May 22, 2024 03:04
Migrate from eslint-plugin-import to eslint-plugin-import-x
// Migrate from eslint-plugin-import (no ESLint v9 support, multiple issues and missing features)
// to eslint-plugin-import-x
//
// - https://www.npmjs.com/package/eslint-plugin-import
// - https://www.npmjs.com/package/eslint-plugin-import-x
// First, install `eslint-plugin-import-x` (and for TypeScript support, `@typescript-eslint/parser`)
-import eslintImport from 'eslint-plugin-import';
+import eslintImportX from 'eslint-plugin-import-x';
@Minionguyjpro
Minionguyjpro / Activate_Driver_Booster_Pro_for_free_with_serial_key_and_no_crack.md
Last active May 22, 2024 03:01
Activate Driver Booster Pro for free with serial key and no crack

Activate Driver Booster Pro for free with serial key and no crack

An guide how to get and activate IObit Driver Booster Pro for free with the official version.

How to

To begin, open Driver Booster Then, click on "scan" button. After that, click on the key in the right bottom. Now enter the serial key for your version from here in the box, then click "activate".

Last words

You successfully got and activated IObit's Driver Booster 9 Pro for FREE without any virus software or cracks. Comment on this gist for questions.

@Minionguyjpro
Minionguyjpro / Activate_Windows_8_8.1_10_and_11_Pro_for_Free.md
Last active May 22, 2024 03:01
Activate Windows 8, 8.1, 10 and 11 Pro for Free

Activate Windows 8, 8.1, 10 and 11 Pro for Free

A guide how to get and activate Windows 8, 8.1, 10 and 11 Pro for free!

NOTE

If you see the Windows keyboard button in this guide; and you can't find it on your keyboard, you likely have/had Windows 10 which has the button . If you can't find that one, you likely have a PC that has been upgraded to Windows 8/8.1/10/11 from Windows 8.1/8/7/Vista/XP and other ones. If you have one of those, refer the Windows key button to as yours. A list of them is below:

Windows key buttons

- Windows 11

- Windows 10